const express = require("express");
let app = express();
// const mongoose = require("mongoose");
let userModel = require("./models/userModel");
// mongoose.connect("mongodb://localhost:27017/myusers");
// let schema = mongoose.Schema({
//   name: String,
//   age: Number,
// });
// let model = mongoose.model("users", schema);
app.set("views", __dirname + "/views");
app.set("view engin", "ejs");
app.get("/showusers", async (req, res) => {
  let data = await userModel.find();
  console.log(data);
  res.render("users.ejs", { data });
});
app.listen(8989);
